package com.cjst.util.toilet;

import java.util.HashMap;

import com.cjst.util.MyMap;
import com.cjst.util.common.HttpClentPost;
import com.cjst.util.json.JsonUtil;

public class ToiletUtil {
	/**
	 * 得到token
	 * @param username
	 * @param password
	 * @return
	 */
	public static String getToken(String username,String password){
		HashMap<String, Object> map=new HashMap<String, Object>();
		map.put("username", "13332999209");
		map.put("password", "123456");
		String result=HttpClentPost.postJson(ToiletUrl.URL+ToiletUrl.LOGIN, map);
		MyMap.getMyMap().put2("token", result);
		return result;
	}
	/**
	 * 得到token转实体类
	 * @param result
	 * @return
	 * @throws Exception
	 */
	public static Toilet strToToilet(String result) throws Exception{
		return JsonUtil.json2pojo(result, Toilet.class);
	}
}




